<?php

class UController extends RestController
{
	public $userId;
    public $token;
	public function beforeAction($action)
	{
        $this->userId = $this->_post('user_id');
        $this->token = TOKEN;
        if(!$this->checkUserToken($this->userId,$this->token))
        {
            $data = array('success'=>0,'action'=>'login','code'=>-1,'message'=>'请重新登录');
            Yii::trace('check Token failed,params are user_id='.$this->userId.' and token='.$this->token);
            $this->setResult($data);
        }
        parent::beforeAction($action);
        return true;
	}
}